package example.classlevel;

import java.awt.Color;
import java.awt.FlowLayout;
import java.awt.event.ActionListener;

import javax.swing.JFrame;
import javax.swing.JScrollPane;
import javax.swing.JTextArea;
import javax.swing.border.BevelBorder;
import javax.swing.border.LineBorder;
import javax.swing.border.TitledBorder;

import spec.state.SDReader;
import testcasegenerator.clp.classlevel.TestDataGenerator;
import testcodegenerator.classlevel.JUnitCodeGenerator;




public class GUI2 extends JFrame{
	
	private JTextArea showState = new JTextArea();
	private JTextArea showDUPair = new JTextArea();
	private JTextArea showPath = new JTextArea();
	private JTextArea showJUnit = new JTextArea();
	
	SDReader Reader;
	TestDataGenerator DataGenerator;
	JUnitCodeGenerator jcode;
	
	public GUI2(GUI e){
		
		Reader = e.getReader();
		DataGenerator = e.getDataGenerator();
		jcode = e.getJcode();
		
		JScrollPane JshowState = new JScrollPane(showState);         
        JScrollPane JshowDUPair = new JScrollPane(showDUPair);          
        JScrollPane JshowPath = new JScrollPane(showPath);        
        JScrollPane JshowJUnit = new JScrollPane(showJUnit);
      
		
        
        JshowState.setBounds(50,10,300,400);
		JshowDUPair.setBounds(400,10,200,400);
		JshowPath.setBounds(50,450,550,400);
		JshowJUnit.setBounds(625,10,425,825);
        
        
		JshowState.setBorder(new TitledBorder("UML State Diagram"));
		JshowDUPair.setBorder(new TitledBorder("Definition-Use Pairs"));
		JshowPath.setBorder(new TitledBorder("Feasible Test Paths"));
		JshowJUnit.setBorder(new TitledBorder("JUnit Test Class"));
		
		
		
		showState.append(Reader.showOnGUI());
		showDUPair.append(DataGenerator.showDUPairOnGUI());
		showPath.append(jcode.showPathAndCoveredOnGUI());
		showJUnit.append(jcode.showJUnitCode());
		
		
		setLayout(null);
		
		add(JshowState);
		add(JshowDUPair);
		add(JshowPath);
		add(JshowJUnit);
		
		
	}
	
	
	

}
